F-Zero X Track Uploader v1.0beta (Console Only)

  This utility will upload previously-created F-Zero X tracks to the console version of the game.  So there isn't any confusion, this will *not* edit courses, only send them to your N64.  The uploaded track will replace the selected track any time it is selected until you turn the power off.  Finally, you can play those pesky DD courses on console without a couple hundered dollar investment.  Source is provided, of course, if you get sick of how crappy it is.
  At the moment, only the North American version of the game is fully supported.  This is a sort of pre-release version, so don't be too critical of it.  Oh, pardon ahead of time for how utterly terrible my programming skills are.

----------------------------

  What you'll need:
	8MB Expansion Pak or one of several cheaper knockoffs. 
	Gameshark Pro/Action Replay 3.2 or higher (the one with a parallel port on the back) 
	Comms transfer cable (it's just a standard 25-pin printer extention cable) 
	F-Zero X cartridge as well as a cartridge that does not use a keycode.
	A course or two to upload, some of which are provided.
	Track Uploader, fudge.asm, and InpOut32.dll.

InpOut32.dll can be either in the program's directory or your WINDOWS/SYSTEM or WINDOWS/SYSTEM32 folder.  This thing allows you to use the parallel port infinitely without the ordinary troubles of Windows XP.
Fudge.asm is a hidden file that should always be in the same directory as Track Uploader.exe

----------------------------

The Nitty-Gritty:
  Running F-Zero X is slightly more complicated than most games.  It uses a keycode in order to boot.  If you are using a version 3.2 or 3.3 Gameshark, you probably already have it on your device.  If you don't, here they are:

gameshark version 3.2
B6 F4 6A E1 8B 0F C8 AB 67 80 20 04 00 

gameshark version 3.3
C4 6F 1B C2 6C 6C 1F 67 1D 80 20 04 00 

  First, place a game that does not use a keycode on your GS, such as Mario64 or GoldenEye.  Start your N64, select Keycodes from the GS main menu, then select the F-Zero keycode from the list.  Select "Yes" when it asks if you want to use this keycode, then turn the game off at the prompt.
  Place F-Zero X on your gameshark and it should boot.  Go into the code menu.  F-Zero X uses an enable code.  If the game is not already listed, press Z in the code list menu.  This should give you the option to create a new catagory.  Choose "detect game" and create your new catagory.  Select it from the game list and add this code:
F-Zero X Enable code:
"(M)"
DE067000 0000
Be sure to call it (M).  Select it if it not already selected.

  When you have select F-Zero X and double-checked the (M) code is entered, press start.  Connect your PC comm cable to the port on the GS now.  Select "Code Generator ON" and either press start or select "Start Game With Selected Codes".  You will know code generator is working if the LCD display on the GS starts "ticking" after the N64 splash screen.

  Press start on the F-Zero X main menu.  You can run the Track Uploader at almost any time in the game, but the ideal time is on the main game select menus.  Simply start Track Uploader, and when your PC cable is connected to the GS press any button to contact the game.  It will patch your game to allow track upload and grab a list of any tracks already replaced.  There isn't any support to erase tracks yet, even though it really isn't complicated at all.
  You'll be able to select what course from what cup you want to replace.  Only courses that have not been replaced are listed. Every course on the game can (theoretically) be replaced except the X-track selection.  Select the course to be replaced, then give it the filename of the course you want to replace it with.  It will load the binary file to the correct position and change the text to whatever is embedded in the file.  You'll be able to play the replaced stage until you turn the power off to your N64.  It's that simple.

----------------------------

File Format:
At the moment there is no compression supported or whatnot.  All files are raw binary.
The first 0x7E0 bytes are the course itself.  The format's already been covered, so no point in doing it again.
0x7E0 is the name of the stage.  It is just a standard string null-terminated.  ASCII is fine, as well as that funky pushed-932 format common to N64 games.
0X800 is the stage description.  Just like the stage name it is a 32byte null-terminated string.  This is something of overkill, but there's room to spare.

----------------------------

Help!
F-Zero X Doesn't Boot With GS:  Read the bit on keycodes and enable codes above.

Deleting Courses Leaves Old Text:  I was lazy and haven't implemented changing text back.  Sorry ;*)

Unsupported Game:  As far as I know there is only one commercial North American F-Zero X cartridge.  If there are others let me know (email below with instructions).  This program reads the checksum from your game to see if it is the correct region.  Within all likelyhood, no other N64 game will have the same checksum value and so the program will abort.
  The only way around this is to recompile the provided sourse with a different region code.

Timeout Error:  This happens when the PC can't make contact to the GS within a certain amount of time.  Be sure to check your cables and try again.  Be sure Code Generator was turned on; without it your PC can not contact the N64.  You may need to reboot the N64 to get it to work.  Also, make sure that InpOut32.dll is either in your system folder or with the program.
  If the problem is persistant it may be the wrong port is being used or your computer accesses the port vastly too quickly.  If your GS LCD display does not work - especially 3.3 models - they probably did a crappy job soldering and a short is preventing you from using the port.  Thankfully that can be repaired.

Can Not Find fudge.asm:  Fudge.asm is the nifty handle that allows the courses to be replaced.  It is a hidden file that should have been provided with the program.  It must be in the same directory as Track Uploader.exe and can not be renamed.  If you continue to have problems, try moving both files to a different directory.

Filenames:  This is a console program so drag-and-drop is most effective the closer to the drive letter you get.  If it never accepts a filename try moving your folder closer to the drive letter or moving the files to be loaded into the same directory as the program.

The Level Didn't Update:  If you uploaded the stage while you were in the track select menu for that cup, exit the menu, move to another cup, then go back to the uploaded stage.  That should refresh it.

Text Didn't Update (but course did):  Exit the stage select menu or select a different cup, then return to the stage you updated.  That should reset text.  Also, course descriptions will not be updated if you delete the active codes in code generator.  They are setting a different address to look for the description strings.

Game Crashes:  There are a few common reasons, outlined below-
	-After Exiting Program:  This would only happen if you close the track uploader while it is reading or writing to the cartridge.  It did not have time to disable the comms.  You may be able to run some other comms program to close the stream for you, but most likely you will need to reboot your N64.
	-When First Running The Program:  This most commonly happens if you run the program for the first time from the track select menu.  It does something funny to the text display and has a good chance of crashing the game if text is actually being used at that point.
	-When Uploading a Level:  I've only had this happen if you upload the level while you are on track select menu.  The safest time to upload tracks is on the main menu screen.
	-When Selecting the Track:  Your track data may be bad.  Also see "-Uploading a Level".
	-When Playing the Track (but after selecting the track):  Ahh, this is an interesting one.  Console is not the same as emulation.  Look through your track data starting at 0x20.  These are the track points.  There will be 3 float values, two halfwords, and a word made up of flags.  For example:
45228000 44FA0000 45796000 01040104 18000000
The 18000000 is the interesting one.  Search for the value 000001BF and change it to 100001BF.
Those values are gaps in the track.  The early 64DD patches set the values improperly.

After Switching Keycodes My GS Doesn't Work:  This is rare but occationally it doesn't update the checksums improperly.  To correct this, take a different GS with the same version bios (3.2 to 3.2, 3.3 to 3.3) and place it under the one you want to reboot.  Place a non-keycode game on top of the two GS and turn the power on.  Both GS counters should tick down.
  Enter the Keycode menu and select the first keycode from the list.  Now, both GS should be reset to normal.
To help prevent this from happening, wait a few seconds after the prompt is displayed to turn the N64 power off.  This will ensure it has time to properly calculate and store the new checksum value.

----------------------------

Will this not load with your NTSC cartridge?  Send an email to nefariousdogooder@yahoo.com
Enter this code into your gs:
"GS Memory Hack"
81791E06 FFFF
81791E02 0000
81791E3A FFFF
81791E36 0000
81791E32 0000
81791DF6 0000
Choose "code generator on" and press the GS button during the game to enter memory editor.
In memory editor go to address B0000010 and copy down the first four bytes of data.
Send that to me and I'll implement it for your system.

If you have a japanese Action Replay and would like to help get the thing working with your game, contact me!
Have a 64DD?  Let's see if a GS works with it!  Let me know if Memory Editor will work while a 64DD is running.

-Zoinkity
nefariousdogooder@yahoo.com
